import request from "@/utils/request.js";

// 获取文章列表
export const getArticleListService = (params) => {
    return request.get('/article', {params: params})
}

// 新增文章
export const addArticleService = (data) => {
    return request.post('/article', data)
}

// 修改文章
export const updateArticleService = (data) => {
    return request.put('/article', data)
}

// 删除文章
export const deleteArticleService = (id) => {
    return request.delete(`/article/${id}`)
}

// 批量删除文章
export const deleteArticleBatchService = (ids) => {
    return request.post('/article/deleteBatch', {ids});
};

// 获取分类名称
export const getCategoryNameService = () => {
    return request.get('/article/category')
}